package com.ins.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 错误枚举
 *
 * @author ins
 * @since 2023-3-10
 */
@Getter
@AllArgsConstructor
public enum ErrEnum {

    /**
     * 请求相关
     */
    REQ_SERVER_ERR(500, "请求失败，请联系客服"),
    SUCCESS(200, "操作成功"),
    REQ_PARAM_LACK(400, "缺少必要参数"),
    REQ_PARAM_ERROR(402, "参数类型有误"),
    ILLEGAL_PARAMETER(404, "非法参数"),
    PARAM_SIGN_ERROR(406, "参数签名有误"),
    USERNAME_IS_EXIST(407, "已存在相同姓名"),
    ACCOUNT_IS_EXIST(421, "已存在相同账号"),
    PHONE_IS_EXIST(422, "已有相同的联系电话"),
    QPS(408, "当前请求数过高，请稍后再试"),

    /**
     * 登录授权相关
     */
    UNAUTHORIZED(401, "未登录"),
    FORBIDDEN(403, "无访问权限"),
    RE_LOGIN(300, "登录超时，请重新登录"),
    ACCOUNT_NOT_EMPTY(413, "账号不能为空"),
    PASSWORD_NOT_EMPTY(414, "密码不能为空"),
    USERNAME_OR_PASSWORD_ERROR(415, "用户名或密码错误"),
    LOGIN_SUCCESS(200, "登录成功"),
    OLD_PASSWORD_ERROR(416, "原密码错误"),
    NEW_PASSWORD_NOT_EQ_CONFIRM_PASSWORD(417, "和新密码不一致，请重新输入"),
    NEW_PASSWORD_NOT_EQ_OLD_PASSWORD(418, "新密码不能和原密码相同"),
    ;

    private final int code;
    private final String msg;
}
